// ============================================================================
//
// LCP-net framework by Pierre CHATEL chatelp@gmail.com
// Distributed under GPLv3
// Copyright (C) THALES Land & Joint Systems, 2008, 2009. All rights reserved
//
// ============================================================================

/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package com.thalesgroup.preferenceFramework.models.LCPnet;

import org.eclipse.emf.common.util.EList;

import com.thalesgroup.graphFramework.core.Graph;
import com.thalesgroup.preferenceFramework.models.PreferenceNetwork;
import com.thalesgroup.preferenceFramework.models.LCPnet.exceptions.LCPnetEvaluationException;

/**
 * <!-- begin-user-doc --> A representation of the model object '
 * <em><b>LC Pnet</b></em>'. <!-- end-user-doc -->
 *
 * <p>
 * The following features are supported:
 * <ul>
 *   <li>{@link com.thalesgroup.preferenceFramework.models.LCPnet.LCPnet#getUtilityDomain <em>Utility Domain</em>}</li>
 *   <li>{@link com.thalesgroup.preferenceFramework.models.LCPnet.LCPnet#getValueDomains <em>Value Domains</em>}</li>
 * </ul>
 * </p>
 *
 * @see com.thalesgroup.preferenceFramework.models.LCPnet.LCPnetPackage#getLCPnet()
 * @model
 * @generated
 */
public interface LCPnet extends PreferenceNetwork {
	/**
	 * Returns the value of the '<em><b>Utility Domain</b></em>' containment reference.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Utility Domain</em>' containment reference
	 * list isn't clear, there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Utility Domain</em>' containment reference.
	 * @see #setUtilityDomain(LinguisticDomain)
	 * @see com.thalesgroup.preferenceFramework.models.LCPnet.LCPnetPackage#getLCPnet_UtilityDomain()
	 * @model containment="true" required="true"
	 * @generated
	 */
	LinguisticDomain getUtilityDomain();

	/**
	 * Sets the value of the '{@link com.thalesgroup.preferenceFramework.models.LCPnet.LCPnet#getUtilityDomain <em>Utility Domain</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Utility Domain</em>' containment reference.
	 * @see #getUtilityDomain()
	 * @generated
	 */
	void setUtilityDomain(LinguisticDomain value);

	/**
	 * Returns the value of the '<em><b>Value Domains</b></em>' containment reference list.
	 * The list contents are of type {@link com.thalesgroup.preferenceFramework.models.LCPnet.LinguisticDomain}.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Value Domains</em>' containment reference list
	 * isn't clear, there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Value Domains</em>' containment reference list.
	 * @see com.thalesgroup.preferenceFramework.models.LCPnet.LCPnetPackage#getLCPnet_ValueDomains()
	 * @model containment="true" required="true"
	 * @generated
	 */
	EList<LinguisticDomain> getValueDomains();

	/**
	 * Test preference network for potential runtime cycles. To do so, it will
	 * test all potential assigned LCP-Nets: meaning all ci-arcs will be
	 * resolved to i-arcs.
	 * 
	 * @return true if there will be no cycles at runtime.
	 * @model kind="operation"
	 * @generated
	 */
	boolean isAcyclic() throws LCPnetEvaluationException;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model required="true" exceptions="com.thalesgroup.preferenceFramework.models.LCPnet.exceptions.LCPnetEvaluationException" nodeNamesRequired="true" nodeNamesMany="true" nodeValuesRequired="true" nodeValuesMany="true"
	 * @generated
	 */
	double getUtility(EList<String> nodeNames, EList<Double> nodeValues) throws LCPnetEvaluationException;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model required="true" exceptions="com.thalesgroup.preferenceFramework.models.LCPnet.exceptions.LCPnetEvaluationException" nodeNamesRequired="true" nodeNamesMany="true" nodeValuesRequired="true" nodeValuesMany="true"
	 * @generated
	 */
	LTwoTuple getLinguisticUtility(EList<String> nodeNames, EList<LTwoTuple> nodeValues) throws LCPnetEvaluationException;

	/**
	 * Compute a finalized graph based on the preference network and current
	 * node values given as an outcome. In this finalized graph, CI-Arcs
	 * directions have been fixed.
	 * 
	 * @param outcome
	 *            current node values given as an outcome.
	 * @return the finalized graph.
	 */
	Graph<LNode, Void> getFinalizedGraph(COutcome outcome) throws LCPnetEvaluationException;

	/**
	 * Compute a finalized graph based on the preference network and current
	 * node values given as an outcome. In this finalized graph, CI-Arcs
	 * directions have been fixed.
	 * 
	 * @param nodeValues
	 *            current node values. All node values must be provided for the
	 *            graph.
	 * @return the finalized graph.
	 */
	Graph<LNode, Void> getFinalizedGraph(EList<CNodeValue> nodeValues) throws LCPnetEvaluationException;

	/**
	 * Compute all finalized graphs by choosing all possible combinations of
	 * CI-Arcs directions.
	 * 
	 * @return an array containing all the finalized graphs.
	 */
	Graph<LNode, Void>[] getAllPossibleFinalizedGraphs() throws LCPnetEvaluationException;

} // LCPnet
